package com.lz.annotations.inherit0;

import java.lang.annotation.Annotation;

/**
 * App..
 * 没有{@link java.lang.annotation.Inherited}注解获取不到超类的注解
 * 有时可以获取到注解
 * @author Lizhong
 * @date 2019/5/9
 */
public class App {
    public static void main(String[] args) {
        Annotation[] aAnnotations = A.class.getAnnotations();
        Annotation[] bAnnotations = B.class.getAnnotations();
        for (Annotation annotation : aAnnotations) {
            System.out.println("A:"+aAnnotations);
        }
        for (Annotation annotation : bAnnotations) {
            System.out.println("B:"+aAnnotations);
        }
    }
}

@Second()
class A {
}

class B extends A {
}